﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SearchNode2.aspx.cs" Inherits="Workflow.Project.SearchNode2" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="../Css/bootstrap-responsive.css" />
    <link rel="stylesheet" type="text/css" href="../Css/style.css" />
    <link type="text/css" rel="stylesheet" href="../Css/pagination.css" />
    <script type="text/javascript" src="../Js/jquery.js"></script>
    <script type="text/javascript" src="../Js/jquery.sorted.js"></script>
    <script type="text/javascript" src="../Js/bootstrap.js"></script>
    <script type="text/javascript" src="../Js/ckform.js"></script>
    <script type="text/javascript" src="../Js/common.js"></script>

    <script type="text/javascript" src="../Scripts/MyJquery.js"></script>
    <script type="text/javascript" src="../Scripts/jquery.js"></script>
    <script type="text/javascript" src="../Scripts/jquery.pagination.js"></script>
    <script type="text/javascript" src="../Scripts/Pageination.js"></script>
    <style type="text/css">
        body {
            padding-bottom: 40px;
        }

        .sidebar-nav {
            padding: 9px 0;
        }

        @media (max-width: 980px) {
            /* Enable use of floated navbar text */
            .navbar-text.pull-right {
                float: none;
                padding-left: 5px;
                padding-right: 5px;
            }
        }


        .auto-style1 {
            width: 230px;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
        <div style="margin:40px;">
            <asp:DropDownList ID="ddlSelect" runat="server"  AutoPostBack="True" OnSelectedIndexChanged="ddlSelect_SelectedIndexChanged">
                <asp:ListItem Value="1">阶段查询</asp:ListItem>
                <asp:ListItem Value="2" Selected="True">节点查询</asp:ListItem>
                <asp:ListItem Value="3">节点完成率查询</asp:ListItem>
                <asp:ListItem Value="4">样品前置审批查询</asp:ListItem>
                <asp:ListItem Value="5">样品发货查询</asp:ListItem>
                <asp:ListItem Value="6">项目执行进度查询</asp:ListItem>
                <asp:ListItem Value="7">活动查询</asp:ListItem>
            </asp:DropDownList>
        </div>
        <div>
            <table class="table table-bordered table-hover definewidth m10">

                <tr>
                    <td class="tableleft">模具号</td>
                    <td class="auto-style1">
                        <asp:TextBox ID="txtNo1" runat="server"></asp:TextBox></td>
                    <td>
                        <%--<asp:TextBox ID="txtNo2" runat="server"></asp:TextBox>--%></td>
                </tr>
                <tr>
                    <td class="tableleft">时间区间</td>
                    <td class="auto-style1">
                        <asp:TextBox ID="txtCreateTime1" type="date" runat="server" Width="174px"></asp:TextBox></td>
                    <td><asp:TextBox ID="txtCreateTime2" type="date" runat="server" Width="174px"></asp:TextBox></td>
                </tr>
                <tr>
                    <td class="tableleft">项目创建人</td>
                    <td class="auto-style1">
                        <asp:TextBox ID="txtPJCreater" runat="server"></asp:TextBox></td>
                    <td></td>
                </tr>
                <tr>
                    <td class="tableleft"></td>
                    <td class="auto-style1">
                        <asp:Button ID="BtnSubmit" CssClass="btn btn-primary" runat="server" Text="查询" OnClientClick="return Validate()" OnClick="BtnSubmit_Click" />
                    </td>
                    <td></td>
                </tr>
            </table>
            <% if(resultList.Count>0){ %>
            <table class="table table-bordered definewidth m10">
                <thead>
                    
                        <tr>
                            <th>模具号</th>
                            <th>项目创建人</th>
                            <th>FOT预估完成时间</th>
                            <th>OTS预估完成时间</th>
                            <th>T/R预估完成时间</th>
                            <th>PPAP预估完成时间</th>
                            <th>PSW预估完成时间</th>
                            <th>进入爬坡预估完成时间</th>
                            <th>退出爬坡预估完成时间</th>
                            <th>FOT完成时间</th>
                            <th>OTS完成时间</th>
                            <th>T/R完成时间</th>
                            <th>PPAP完成时间</th>
                            <th>PSW完成时间</th>
                            <th>进入爬坡完成时间</th>
                            <th>退出爬坡完成时间</th>
                        </tr>
                    
                </thead>
                <tbody id="Searchresult"></tbody>
                <tbody id="hiddenresult" style="display: none">
                    <% for (int i = 0; i < resultList.Count; i++)
                       { %>
                    <tr class="result">
                        <td><a href="#" onclick="SearchLog('SearchMain1.aspx','<%= resultList[i].PJId %>')"><% =resultList[i].PJId %></a></td>
                        <td><% =resultList[i].DisplayName %></td>
                        <td id="t1end<%=i %>">
                            <label id="l1end<%=i %>" class="date"><%=resultList[i].CompleteDate1.ToShortDateString()%></label>
                        </td>
                        <td id="t2end<%=i %>">
                            <label id="l2end<%=i %>" class="date"><%=resultList[i].CompleteDate2.ToShortDateString()%></label>
                        </td>
                        <td id="t3end<%=i %>">
                            <label id="l3end<%=i %>" class="date"><%=resultList[i].CompleteDate3.ToShortDateString()%></label>
                        </td>
                        <td id="t4end<%=i %>">
                            <label id="l4end<%=i %>" class="date"><%=resultList[i].CompleteDate4.ToShortDateString()%></label>
                        </td>
                        <td id="t5end<%=i %>">
                            <label id="l5end<%=i %>" class="date"><%=resultList[i].CompleteDate5.ToShortDateString()%></label>
                        </td>
                        <td id="t6end<%=i %>">
                            <label id="l6end<%=i %>" class="date"><%=resultList[i].CompleteDate6.ToShortDateString()%></label>
                        </td>
                        <td id="t7end<%=i %>">
                            <label id="l7end<%=i %>" class="date"><%=resultList[i].CompleteDate7.ToShortDateString()%></label>
                        </td>
                        <td id="t1realend<%=i %>">
                            <label id="l1realend<%=i %>" class="date"><%=resultList[i].RealCompleteDate1.ToShortDateString()%></label>
                        </td>
                        <td id="t2realend<%=i %>">
                            <label id="l2realend<%=i %>" class="date"><%=resultList[i].RealCompleteDate2.ToShortDateString()%></label>
                        </td>
                        <td id="t3realend<%=i %>">
                            <label id="l3realend<%=i %>" class="date"><%=resultList[i].RealCompleteDate3.ToShortDateString()%></label>
                        </td>
                        <td id="t4realend<%=i %>">
                            <label id="l4realend<%=i %>" class="date"><%=resultList[i].RealCompleteDate4.ToShortDateString()%></label>
                        </td>
                        <td id="t5realend<%=i %>">
                            <label id="l5realend<%=i %>" class="date"><%=resultList[i].RealCompleteDate5.ToShortDateString()%></label>
                        </td>
                        <td id="t6realend<%=i %>">
                            <label id="l6realend<%=i %>" class="date"><%=resultList[i].RealCompleteDate6.ToShortDateString()%></label>
                        </td>
                        <td id="t7realend<%=i %>">
                            <label id="l7realend<%=i %>" class="date"><%=resultList[i].RealCompleteDate7.ToShortDateString()%></label>
                        </td>
                        <td><a href="#" onclick="SearchLog('SearchLog.aspx','<%= resultList[i].PJId %>')">日志</a></td>

                    </tr>
                    <% }%>
                </tbody>
            </table>
            <%}%>
            <div id="Pagination" class="pagination definewidth m10"></div>
        </div>
    </form>
    <script type="text/javascript">
        $(document).ready(function () {
            var count = "<% =resultList.Count%>";
            if (count >= 10) {
                $("#Pagination").show();
            } else {
                $("#Pagination").hide();
            }
            $(".date").each(function () {
                if ($(this).text() == "1900/01/01" || $(this).text() == "1900/1/1") {
                    $(this).text("");
                }
            });
            List();
            $("a").click(function () {
                List();
            });


        });
        function List() {
            var count = "<% =resultList.Count%>";
            for (var i = 0; i < count; i++) {
                ShowColor("#l1end", "#l1realend", "#t1realend", i);
                ShowColor("#l2end", "#l2realend", "#t2realend", i);
                ShowColor("#l3end", "#l3realend", "#t3realend", i);
                ShowColor("#l4end", "#l4realend", "#t4realend", i);
                ShowColor("#l5end", "#l5realend", "#t5realend", i);
                ShowColor("#l6end", "#l6realend", "#t6realend", i);
                ShowColor("#l7end", "#l7realend", "#t7realend", i);
            }
        }
        function ShowColor(str1, str2, str3, i) {
            var date1 = new Date($(str1 + i).text());
            var date2 = new Date($(str2 + i).text());
            var today = Date.now();
            if (date1 >= date2) {
                $(str3 + i).attr("class", "greenColor");
            }
            else if (date1 < date2) {
                $(str3 + i).attr("class", "yellowColor");
            }
            else if ($(str2 + i).text() == "" && date1 < today) {
                $(str3 + i).attr("class", "redColor");
            }
            else {

            }
        }
        function Validate() {
            if ($("#txtNo1").val().length = 0) {
                alert('请输入模具号');
                return false;
            }
        }

    </script>
</body>
</html>